/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.univcasa.managing.impl;

import com.univcasa.db.model.CompteEtudiant;
import com.univcasa.db.model.Criteres;
import com.univcasa.db.model.MoodleFlag;
import com.univcasa.managing.MoodleDBManager;
import java.util.Iterator;
import java.util.List;



/**
 *
 * @author issam
 */
public class testMoodleManager {
    
    public static void main(String[] args){
              //testAddFlag();
            //testListFlag();
        testMoodleUser();
    }

    public static void testAddFlag(){
        MoodleDBManager manager = new MoodleDBManagerImpl();
        CompteEtudiant std = new CompteEtudiant();
        std.setApogee("1212121");
        manager.addStd2MoodleSync(std);
    }
    
    public static void testListFlag(){
        MoodleDBManager manager = new MoodleDBManagerImpl();
        CompteEtudiant std = new CompteEtudiant();
        Criteres crits = new Criteres();
        crits.addCritere("type", "std");
        List lista = manager.getListComptesMoodle( crits );
        for(Iterator itr=lista.iterator() ; itr.hasNext();  ){
            MoodleFlag flag = (MoodleFlag) itr.next();
            System.out.println("FLAG: " + flag );
        }
    }

    public static void testMoodleUser(){
        MoodleDBManager manager = new MoodleDBManagerImpl();
        System.out.println( manager.isExistInMoodle("SAGAL.IBRAHIM12") );

    }
    
}
